package com.cch.check.controller;

import com.aaa.entity.CareOrderItem;
import com.aaa.entity.CheckResult;
import com.aaa.vo.Result;
import com.alibaba.fastjson.JSON;
import com.cch.check.service.impl.DecheckAddServiceImpl;
import com.cch.check.service.impl.DecheckServiceImpl;
import com.cch.check.vo.DocheckVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 开诊细表(HisCareOrderItem)表控制层
 *
 * @author makejava
 * @since 2023-03-27 10:56:56
 */
@RestController
@RequestMapping("check/CareOrderItem")
public class CareOrderItemController {
    @Autowired
    private DecheckServiceImpl decheckService;
    @Resource
    private DecheckAddServiceImpl decheckAddService;
    @PostMapping("/doch")
    public Result<List<CareOrderItem>> finduser(

            @RequestBody DocheckVo docheckVo
    ){
        return decheckService.findAll(docheckVo);
    }



    @PostMapping("/add")
    public Result addcheck (@RequestBody CheckResult checkResult){
        System.out.println("checkResult =================== " + JSON.toJSONString(checkResult));
        boolean b = decheckAddService.add(checkResult);
        return new Result(2000,"添加成功",b);
    }






}










































//    /**
//     * 服务对象
//     */
//    @Autowired
//    private CareOrderItemService careOrderItemService;
//
//    //查询新开检查
//    @PostMapping("selectAll")
//    public Result<List<CareOrderItem>> selectAll (
//            @RequestBody CheckItemVo checkItemVo
//    ){
//        return careOrderItemService.selectAll(checkItemVo);
//    }
